#include <sdopencv/polygon.hpp>

std::istream& operator >>(std::istream &is, sdopencv::CvPolygon &obj)
{
    int n, i, x, y;
    is >> n;
    obj.resize(n);
    for(i = 0; i < n; ++i)
    {
        is >> x >> y;
        obj[i] = cvPoint(x,y);
    }
    return is;
}

std::ostream& operator <<(std::ostream &os, const sdopencv::CvPolygon &obj)
{
    os << obj.size() << "   ";
    for(unsigned i = 0; i < obj.size(); ++i)
        os << obj[i].x << " " << obj[i].y << "   ";
    os << std::endl;
    return os;
}
